<!-- 详细信息 -->

<template>
  <div class="DetailLiftVertical-MyDetail">
    <div class="inFlex">
      <label>厂商</label>
      <div>
        <span>{{ obj.manufacturerName || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>型号</label>
      <div>
        <span>{{ obj.model || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>平层状态</label>
      <div>
        <span>{{ obj.props.level.text || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>行梯状态</label>
      <div>
        <span>{{ obj.props.runState.text || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>开门状态</label>
      <div>
        <span>{{ obj.props.door.text || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>当前速度 (米/秒)</label>
      <div>
        <span>{{ (obj.props.speed.text / 100).toFixed(2) }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>开关门次数</label>
      <div>
        <span>{{ obj.props.openClose.text || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>停站次数</label>
      <div>
        <span>{{ obj.props.stop.text || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>运行距离 (千米)</label>
      <div>
        <span>{{ (obj.props.runDis.text / 100000).toFixed(2) }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>运行时长 (小时)</label>
      <div>
        <span>{{ (obj.props.runTime.text / 3600).toFixed(2) }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>是否有人</label>
      <div>
        <span>{{ obj.props.passengerStatus.text || '-' }}</span>
      </div>
    </div>

    <div class="inFlex">
      <label>故障信息</label>
      <div>
        <span class="floatLeft">{{ (obj.props.faultCreateTime.text || '').slice(5, -3) }}</span>
        <span :class="statusClass">{{ obj.props.faultName.text || '正常' }}</span>
      </div>
    </div>

    <div class="flexCC">
      <label>更新时间 ： </label>
      <div>
        <span>{{ obj.props.sendTime.text || '-' }}</span>
        <i class="el-icon-refresh" @click="startOne" />
      </div>
    </div>
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import props from '../MyImg/props'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyDetail',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 属性注册 (抽取以便查阅)
   */
  props,

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 状态样式类
     */
    statusClass() {
      const name = 'DetailLiftVertical-MyDetail-status'
      const alarmStr = this.obj.props.faultName.text ? ` ${name}-alarm` : ''
      return `${name}${alarmStr}`
    },
  },
}
</script>

<style lang="scss">
@import './index.scss';
</style>
